<%--
  Created by IntelliJ IDEA.
  User: gg
  Date: 14-4-23
  Time: 下午3:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="../../common/header.jsp"></jsp:include>
<html>
<head>
    <title></title>
</head>
<body>
<div class="row">
    <div class="col-xs-3 col-md-3">
        <ul id="pDept_tree" treeMenuId="pDept_tree_menu" url="${ctx}/pDept/tree.do" class="defalut_tree col-md-12"></ul>
        <%--<ul id="pDept_tree" class="ztree col-md-12"></ul>--%>
    </div>
    <div class="col-xs-9 col-md-9" id="pUser_table">
    </div>
    <!-- /span -->
</div>
<!-- /row -->
<div id="pDept_tree_menu" class="easyui-menu" style="width:120px;">
    <div data-options="iconCls:'icon-add'" id="add_pDept_button"><span style="padding-left:30px">add</span></div>
    <div data-options="iconCls:'icon-edit'"><span style="padding-left:30px">edit</span></div>
    <div data-options="iconCls:'icon-remove'"><span style="padding-left:30px">remove</span></div>
</div>

</body>
</html>
<before_footer>
    <jsp:include page="../../common/script_index.jsp"></jsp:include>
    <jsp:include page="../../common/script_easyui.jsp"></jsp:include>
    <script src="${ctx}/js/common/page_ajax.js"></script>
</before_footer>
<footer>
    <script type="text/javascript">
        var tableObj = $('#pRole_table');
        var pDept_tree = $('#pDept_tree');
        var pDept_tree_menu = $('#pDept_tree_menu');
        var pUser_table = $('#pUser_table');
        $(function () {
            pDept_tree.initTree({
                onClick: function (node) {
                },
                onContextMenu: function (e, node) {
                    pDept_tree.tree('select', node.target);
                    pDept_tree_menu.menu('show', {
                        left: e.pageX,
                        top: e.pageY
                    });
                }
            });
            pUserTable_initPage();
        })

        function pUserTable_initPage() {
            pUser_table.initTable({
                url: '${ctx}/pUser/table.do'
            });
        }

        $('#add_pDept_button').click(function () {
            var node = pDept_tree.tree('getSelected');
            var urlParams = '?bizId=' + node.id;
            $.openWindow( '${ctx}/pDept/addInDialog.do' + urlParams, 'pDept_add_window', '添加组织部门', 800, 400);
        })
    </script>
</footer>